package com.hzcx.app.simplechat.ui.login.presenter;

import android.content.Context;

import com.hzcx.app.simplechat.api.BaseDialogObserver;
import com.hzcx.app.simplechat.base.BasePresenter;
import com.hzcx.app.simplechat.model.LoginModel;
import com.hzcx.app.simplechat.ui.login.bean.LoginInfoBean;
import com.hzcx.app.simplechat.ui.login.contract.LoginByPwdContract;

public class LoginByPwdPresenter extends BasePresenter<LoginByPwdContract.View> implements LoginByPwdContract.Presenter {

    /**
     *  密码登录
     * @param context
     * @param phone
     * @param pwd
     */
    @Override
    public void loginByPwd(Context context, String phone, String pwd,String area_code) {
        LoginModel.loginByPwd(context, phone, pwd,area_code, new BaseDialogObserver<LoginInfoBean>(context) {
            @Override
            protected void onSuccess(LoginInfoBean data) {
                mView.loginSuccess(data);
            }
        });
    }
}
